home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-04-16 | 951 b | 44 lines | [TEXT/MACH] |
- \ INIT 12 starter
- \ J. Langowski / MacTutor April 1989
- \ Thanks to Eric Carrasco (Calvacom EC10) to this idea
- \ which he implemented in Pascal
-
- : $open-res { addr | refNum -- result }
- addr call openresfile -> refNum
- call ResError L_ext
- dup not IF drop refNum THEN
- ;
-
- : $close-res call CloseResFile call ResError L_ext ;
-
- $4E714E71 CONSTANT nopnop
-
- : runINIT { | refNum hINIT -- }
- " theInit" $open-res -> refNum
- refNum 0 > IF
- ascii INIT 12 call GetResource -> hINIT
- hINIT IF
- hINIT call HomeResFile
- refNum = IF
- hINIT call DetachResource
- hINIT @ execute \ run the INIT
- nopnop hINIT @ ! \ fill first 2 words with NOPs
- ELSE
- " INIT not from my file" 0 0 0 call ParamText
- 1000 0 call NoteAlert drop
- THEN
- ELSE
- " Can't find INIT 12 resource" 0 0 0 call ParamText
- 1000 0 call NoteAlert drop
- THEN
- ELSE
- " Can't open file 'theINIT'" 0 0 0 call ParamText
- 1000 0 call NoteAlert drop
- THEN
- bye
- ;
-
-
-
-
-